<div class="pm_modal small {{ctrl.class}}" role="dialog" style="display: block;">
    <div class="modal-dialog">
        <form method="post" ng-submit="passwordForm.$valid && ctrl.submit()" novalidate="" name="passwordForm">
            <button type="button" ng-click="ctrl.cancel()" aria-hidden="true" title-translate="Close" title-translate-context="Action" class="fa fa-times close"></button>
            <div class="modal-content">
                <div class="modal-header">
                    <h4 ng-if="ctrl.type === 'password' && ctrl.mode === 1" class="modal-title" translate translate-context="Title">Change Password</h4>
                    <h4 ng-if="ctrl.type === 'password' && ctrl.mode === 2" class="modal-title" translate translate-context="Title">Switch to One-Password Mode</h4>
                    <h4 ng-if="ctrl.type === 'login' && ctrl.mode === 2" class="modal-title" translate translate-context="Title">Change Login Password</h4>
                    <h4 ng-if="ctrl.type === 'login' && ctrl.mode === 1" class="modal-title" translate translate-context="Title">Switch to Two-Password Mode</h4>
                    <h4 ng-if="ctrl.type === 'mailbox' && ctrl.mode === 2" class="modal-title" translate translate-context="Title">Change Mailbox Password</h4>
                    <h4 ng-if="ctrl.type === 'mailbox' && ctrl.mode === 1" class="modal-title" translate translate-context="Title">Switch to Two-Password Mode</h4>
                    <h4 ng-if="ctrl.type === 'organization'" class="modal-title" translate translate-context="Title">Change Organization Password</h4>
                </div>
                <div class="modal-body pm_form">
                    <p ng-if="ctrl.type === 'organization'" class="alert alert-info" translate-context="Info" translate>Other administrators exist in your organization, you are responsible for communicating the new password to them.</p>
                    <p ng-if="ctrl.type === 'password' && ctrl.mode === 2" class="alert alert-info" translate-context="Info" translate>ProtonMail can also be used with a single password which replaces both the login and mailbox password. To switch to single password mode, enter the single password you would like to use and click Save.</p>
                    <p ng-if="ctrl.type === 'login' && ctrl.mode === 1" class="alert alert-info" translate-context="Info" translate>Two-password mode uses separate passwords for login and mailbox decryption. This provides a minor security benefit in some situations, however we recommend one-password mode for most users. To switch to two password mode, first set a login password and then set a mailbox password.</p>
                    <label ng-if="ctrl.type === 'password'" for="newPassword" translate-context="Label" translate>New Password</label>
                    <label ng-if="ctrl.type === 'login'" for="newPassword" translate-context="Label" translate>New Login Password</label>
                    <label ng-if="ctrl.type === 'mailbox'" for="newPassword" translate-context="Label" translate>New Mailbox Password</label>
                    <label ng-if="ctrl.type === 'organization'" for="newPassword" translate-context="Label" translate>New Organization Password</label>
                    <password data-id="newPassword" data-name="newPassword" data-value="ctrl.newPassword" form="passwordForm"></password>
                    <label for="confirmPassword" translate-context="Label" translate>Confirm Password</label>
                    <password data-id="confirmPassword" data-name="confirmPassword" data-value="ctrl.confirmPassword" compare="ctrl.newPassword" form="passwordForm"></password>
                    <p class="alert alert-warning" ng-if="ctrl.type === 'password' || ctrl.type === 'login' || ctrl.type === 'mailbox'">
                        <span translate-context="Info" translate>* Do NOT forget this password. If you forget it, you will not be able to login or decrypt your messages.</span><br />
                        <span translate-context="Info" translate>* Save your password somewhere safe. Click on <i class="fa fa-eye"></i> icon to confirm you that have typed your password correctly.</span><br />
                        <span translate-context="Info" translate>* We recommend adding a recovery email address first. Otherwise, you cannot recover your account if something goes wrong.</span>
                    </p>
                    <p class="alert alert-warning" ng-if="ctrl.type === 'organization'">
                        <span translate-context="Info" translate>* Do NOT forget this password. If you forget it, you will not be able to manage your organization.</span><br />
                        <span translate-context="Info" translate>* Save your password somewhere safe. Click on <i class="fa fa-eye"></i> icon to confirm you that have typed your password correctly.</span>
                    </p>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="pm_button modal-footer-button" ng-click="ctrl.cancel()" translate translate-context="Action">Cancel</button>
                <button type="submit" class="pm_button primary modal-footer-button disabled-if-network-activity">
                    <span ng-if="ctrl.type !== 'login' || ctrl.mode !== 1" translate-context="Action" translate>Save</span>
                    <span ng-if="ctrl.type === 'login' && ctrl.mode === 1" translate-context="Action" translate>Next</span>
                </button>
            </div>
        </form>
    </div>
    <div class="modal-overlay"></div>
</div>
